package com.fesine.learn.design.pattern.structural.decorator.v2;

/**
 * @description: 创建装饰类
 * @author: fesine
 * @createTime:2019/4/28
 * @update:修改内容
 * @author: fesine
 * @updateTime:2019/4/28
 */
public abstract class ABattercakeDecorator extends ABattercake {

    /**
     * 组合ABattercake
     */
    private ABattercake aBattercake;

    public ABattercakeDecorator(ABattercake aBattercake) {
        this.aBattercake = aBattercake;
    }

    @Override
    protected String getDesc() {
        doSomething();
        return this.aBattercake.getDesc();
    }

    @Override
    protected int cost() {
        return this.aBattercake.cost();
    }

    protected abstract void  doSomething();
}
